<?php
namespace app\app\controller;

use alisms\Alidayu;
use app\common\controller\App;
use Common\utils\Alisms;
use extend\alisms\AlismsApi;
use think\captcha\Captcha;
use think\Config;
use think\console\command\optimize\Schema;
use think\console\command\Version;
use think\Db;
use think\Exception;
use think\route\Rule;

/**
 * 公共方法，发送短信、省市区三级联动等
 */
class Notice extends App
{

    public function list()
    {
        $list=model("Notice")->order("id desc")->page(1,5)->select();

        return $this->ok('请求成功',$list);
    }


    public function detail()
    {
        $id=request()->param("id",'0','intval');
        $detail=model("Notice")->where(['id'=>$id])->find();
        if (empty($detail)){
            return $this->fail('公告不存在');
        }

        $detail['create_time']=date("Y-m-d H:i:s",$detail['create_time']);

        return $this->ok('请求成功',$detail);
    }


}
